//  [9/4/2013 OMEGA] created

#ifndef _DUELASSEARCHIVEVIEW_H_
#define _DUELASSEARCHIVEVIEW_H_

#include <QMenu>
#include <QTableView>
#include "DuelAssECommon.h"
#include "DuelAssEArchiveModel.h"
#include "DuelAssENoFocusDelegate.h"

class DAssEArchiveView : public QTableView
{
	Q_OBJECT
public:
	DAssEArchiveView(DuelAssetEditor* parent);
	virtual ~DAssEArchiveView();

signals:
	void		removeArchiveEnable(bool flag);
	void		importResourceEnable(bool flag);

public slots:


	void		onProjectLoaded(DAssEProject* proj);
	void		onProjectUnloaded();

	// override : QAbstractItemModel---------
	void		selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
	
	void		openArchive();
	void		removeSelectedArchives();
	void		importResources();

	// receive signals from DuelAsssetEditor.
	void		onArchiveAdded(DAssEArchive* arch, bool isNew);
	void		onArchiveRemoved(DAssEArchive* arch);
	
private:
	DuelAssetEditor*	mParent;
	DAssEWorkbench*		mWorkbench;
	DAssEArchiveModel		mModel;
	NoFocusDelegate		mItemDelegate;
};

#endif